#!/usr/bin/perl --
#$Source: Volumes://MATEOR/prlserverapi/prlserverapi-gui.pl$
#$Date: June 19, 2012$
#$Revision: 0.01-0a$
#
#----------
# PrlServerAPI Copyright Matthew Caswell 2012
#----------
#

use strict;
package xml_0;

my $cont;
my $string;

sub page{
  my($request) = @_;
  
  if($request->{uri}->{params}->{'l'} != 0){
    {
      local $/=undef;
      open FILE, "<./prlserverapi-gui.rc/$request->{uri}->{params}->{'l'}"
        or print "Couldn't open $request->{uri}->{params}->{'l'}";
      binmode FILE;
      $string = <FILE>;
      close FILE;
    }
    $cont = $string;
  }elsif($request->{uri}->{params}->{'e'} != 0){
    open FILE, ">./prlserverapi-gui.rc/$request->{uri}->{params}->{'e'}"
      or print "Couldn't open $request->{uri}->{params}->{'e'}";
    print FILE "<!-- [DUMP: 0] -->";
    close FILE;
  }else{
    $cont = "Internal application error: /xml.0 module usage: /xml.0?l=<xml_file.xml>";
  }
  return $cont;
}

1;
